package Lirmm.VSM;

import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

import Lirmm.DataStructure.Document;

public class MAIN
{

	
	public static void main(String[] args) throws FileNotFoundException, IOException 
	
	{
		
		List<Document> D = new ArrayList<Document>();
		List<Document> Q = new ArrayList<Document>();
		List<String> L1 = new ArrayList<String>();
		List<String> L2 = new ArrayList<String>();
		List<String> L3 = new ArrayList<String>();
		List<String> L4 = new ArrayList<String>();
		
		Document Temp1 = new Document ();
		Document Temp2 = new Document ();
		Document Temp3 = new Document ();
		Document TempQ = new Document ();
		
		Temp1.setTitle("D1");
		L1.add("Shipment of gold damaged in a fire");
		Temp1.setTerms(L1);
		
		
		Temp2.setTitle("D2");
		L2.add("Delivery of silver arrived in a silver truck");
		Temp2.setTerms(L2);
	
		
		Temp3.setTitle("D3");
		L3.add("Shipment of gold arrived in a truck");
		Temp3.setTerms(L3);
		
		
		TempQ.setTitle("Q");
		L4.add("gold silver truck");
		TempQ.setTerms(L4);
	
		//D.add(TempQ);
		D.add(Temp1);
		D.add(Temp2);
		D.add(Temp3);
		
		Q.add(TempQ);
		
		
		/*TDIDF m = new TDIDF();
		m.reading(D, Q, 2);*/
		
		List<String> MethodL = new ArrayList<String>();
		
		double [][] dfidf_Corpus =  {{1,1,1},{0,1,1},{1,0,0},{0,1,0},{1,0,0},{1,0,1},{1,1,1},{1,1,1},{1,0,1},{0,2,0},{0,1,1}} ;
		double [][] dfidf_Queries =  {{0},{0},{0},{0},{0},{1},{0},{0},{0},{1},{1}} ;
		double [][] similarity;
		
		MethodL.add("D1");
		MethodL.add("D2");
		MethodL.add("D3");
		VectorSpaceModel v = new VectorSpaceModel();
		//similarity = v.VSM(MethodL, D); for test



		CosineSimilarity cos=new CosineSimilarity();
		similarity=cos.CosineSimilarityMeasure(dfidf_Queries, dfidf_Corpus );
		
		System.err.println(similarity[0][2]);
		

	}

}
